using System.Workflow.Activities;

namespace SampleWorkflows
{
    public sealed partial class PublishVideo : SequentialWorkflowActivity
    {
        private PublishEventArgs m_args;

        /// <summary>
        /// Initializes a new instance of the <see cref="PublishVideo"/> class.
        /// </summary>
        public PublishVideo()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Gets or sets the args.
        /// </summary>
        /// <value>The args.</value>
        public PublishEventArgs Args
        {
            get { return m_args; }
            set { m_args = value; }
        }

        /// <summary>
        /// Handles the Invoked event of the handleExternalEventActivity1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Workflow.Activities.ExternalDataEventArgs"/> instance containing the event data.</param>
        private void handleExternalEventActivity1_Invoked(object sender, ExternalDataEventArgs e)
        {
            uploadVideo1.AccountID = m_args.AccountID;
            uploadVideo1.AccountKey = m_args.AccountKey;
            uploadVideo1.FilesetName = m_args.FilesetName;
            uploadVideo1.VideoPath = m_args.VideoPath;
            uploadVideo1.ZipPath = m_args.VideoPath.Replace("wmv", "zip");
        }
    }
}